package org.liuyunfeng;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;
import org.springframework.kafka.core.KafkaTemplate;

@SpringBootTest(classes = KafkaApplication.class)
public class KafkaTestApplication {
    @Autowired
    private KafkaTemplate<Object, Object> kafkaTemplate;
    @Autowired
    private ApplicationContext context;


    @Test
    public void send() {
        kafkaTemplate.send("topic-01", "你好吗？").addCallback(System.out::println, System.out::println);
    }
}
